Automatic wsdl download of client emulation for a testing tool

ABSTRACT

A method is disclosed which may include analyzing communication requests in a business process between a client and a server offering a service application to be tested. The method may further include identifying a call to a web service in the analyzed communication. The method may also include determining a location of a Web Service Description Language (WSDL) file relating to the web service on a remote server and downloading the WSDL file from the determined location. A computer readable medium having stored thereon instructions for performing the method and a computer system are also disclosed.

BACKGROUND

Web Services are widely used in modern applications. The term “web service” usually refers to an application programming interface (API) which is accessed and executed on a remote server, which hosts the requested service.

A load testing tool is software designed to examine an application behavior under various load conditions. The testing tool can emulate numerous concurrent users to simulate real-life loads on the tested application. When doing so, the testing tool collects information from various infrastructure components (e.g. system servers), which is analyzed. HP's LoadRunner typically may include several different tools: Virtual User Generator (VuGen), Controller, load generators, Analysis and Launches.

When automatically recording any business process in a load testing tool, such as, for example, LoadRunner™—a popular load testing application available from Hewlett Packard Inc (HP)—various Web Service calls may be found in that process.

Currently, when using LoadRunner and finding a Web Service call the appropriate Web Service Description Language (WSDL) is downloaded manually. WSDL may be an Extensible Markup Language (XML) format for describing network services as a set of endpoints operating on messages containing either document-oriented information or procedure-oriented information. The automation user also has to manually configure the request settings such as security. In the protocols-heavy domain of web services (for example WS-Security, WS-Addressing) this is a major overhead.

BRIEF DESCRIPTION OF THE DRAWINGS

The subject matter regarded as the invention is particularly pointed out and distinctly claimed in the concluding portion of the specification. The invention, however, both as to organization and method of operation, together with objects, features, and advantages thereof, may best be understood by reference to the following detailed description when read with the accompanying drawings. It should be noted that the figures are given as examples only and in no way limit the scope of the invention. Like components are denoted by like reference numerals.

FIG. 1 illustrates an environment of a testing tool for a server in a network, in accordance with an embodiment of the present invention.

FIG. 2 illustrates a method for automated download and configuration of web-services in a testing tool, in accordance with an embodiment of the present invention.

FIG. 3 illustrates a method for automated download of a web-service in a testing tool, in accordance with an embodiment of the present invention.

FIG. 4 illustrates a method for automated configuration of a client emulation for work in a testing tool, in accordance with an embodiment of the present invention.

FIG. 5 illustrates a system for automated download and configuration of web-services in a testing tool, in accordance with an embodiment of the present invention.

DETAILED DESCRIPTION

In accordance with an embodiment of the invention, when using a testing tool, such as, for example, HP's LoadRunner, for business processes monitored in a transport level script, it is suggested to analyze communication requests in a business process between a client and a server offering a service application to be tested. A call to a web service may be identified in the analyzed communication and a location of a Web Service Description Language (WSDL) file relating to the web service on a remote server may be determined from the analyzed communication requests. A WSDL file may be then automatically downloaded from the determined location.

“Transport level script” refers to script which accesses various networked facilities.

Furthermore, it is further suggested to perform automatic configuration of a client emulation to properly work with the application under test (AUT), e.g. configuration settings such as encoding and security settings.

Previously a user would download WSDL files manually and then configure the client emulation so as to facilitate proper use of the WSDL files. Manual downloading and configuring of WSDL requires considerable understanding of Web Services. According to an embodiment of the invention WSDL files may be automatically downloaded.

When a testing tool monitors a business process in transport level, it may capture communication messages passing between the client and the server. These messages may be expressed in a script or a similar entity, which may later be used for simulating the business process by the testing tool using a client emulation.

Commonly, users of the testing tool may manually modify the recorded script for various reasons, such as, for example, correlation and parameterization, but also inserting client side logic to the script, maintaining existing script to support changes of the application, etc.

Therefore, offering the users the ability to modify the script and the readability of the script may be desired.

In general, a script that uses higher level API or terminology is more usable and easy to manipulate.

Web Service calls may be expressed in the script in HTTP level (i.e. by API for handling HTTP messages) or in Web Services level. Working in Web Service level may require the WSDL file of the service.

Web Service level is typically a higher and more usable level. Configuration may be made in service level instead of message level. There is usually no need to modify each message, just the service configuration. Web Service attributes may be expressed as entities and not as a set of Simple Object Access Protocol (SOAP) headers. Also, some security mechanisms like message level security may not be able to simulate in HTTP level, because the relevant SOAP headers are generated dynamically. In addition, working in service level may have the code efficiency advantage that a service proxy may be used for generating the service calls. One of the main proclaimed objects of automatic testing tools is the “record and replay” ability, e.g. simulating the business process after recording it with minimum intervention of the user.

The configuration of the client is complicated and requires wide understanding of Web Services technology. For example, in LoadRunner there are tens of options that the user would have to configure manually. Manual work takes time, and is more prone to mistakes. It requires a wide understanding of Web Services technology that application testers do not usually possess.

According to an embodiment of the invention “record and replay” in service level may be offered.

WSDL may be located and downloaded automatically, for example, in the following manner.

An HTTP message to a web service (WS) server may be captured. The message may be analyzed and heuristics may be employed to find the location of the web service. For example, the location of the web service may be determined from a destination indication of the message or from other parts of the message allowing the determination of the WS location.

The following exemplary scripts relate to Silverlight Web Services (embodiments of the invention may be applicable to other platforms as well):

A. the string “?wsdl” may be added to an endpoint. For example: “http://<host name>/<folders>/<service name>” may be amended to “http://<host name>/<folders>/<service name>?wsdl”.

B. the string “?wsdl” may be appended after the service name in the end point. For example, “http://<host name>/<folders>/<service name>/<port>” may be amended to “http://<host name>/<folders>/<service name>?wsdl”.

For example, the service MEX (Metadata Exchange) endpoint (http://msdn.microsoft.com/enus/library/ms730243.aspx), may be used, running SvcUtil.exe one to obtain service\endpoints locations. In addition, the user may be offered the possibility of manually specifying the WSDL. A local cache may be kept at machine level of previously downloaded WSDL files. When the endpoint is identified from the recorded envelope one may choose the best source for the WSDL, for example, by applying heuristics.

Once the WSDL files are successfully downloaded one may analyze the HTTP message and determine the attributes used by the client in order to properly configure the client.

For example, in Web Services created in Silverlight platform it may be possible to identify which port is used in each request—by matching the HTTP message endpoint to the endpoints of the ports which are specified in the WSDL. It may also be possible to encode binary XML or plain text identified by its HTTP content type.

Additional examples for attributes that may be detected by the corresponding SOAP headers, e.g. duplex binding, Web Service addressing version, authentication mode UserNameOverTransport authentication mechanism (such as used in Silverlight).

Similarly, other attributes may be treated.

According to embodiments of the present invention, Soap messages which may be captured on the wire may be analyzed. This may allow presenting a standards-free request and automatically configure the replay.

For example, consider a client (e.g. Silverlight client) who wants to send a plain XNL message containing the number “42” to a server (“logical message”). Such message may be in the following form (binary encoding is omitted for clearness, this envelope is very simplified and does not necessarily reflect how any of the standards appear in a SOAP):

<envelope> <timestamp>2010-10-18T13:12:53Z</time> <id>730ee669-489e-89ab-8603be9b</id> <user>Michael</user> <data>42</data> </envelope>

The logical message is in fact a “data” element (42).

The message may be subjected to WS standards. The process of applying these standards may involve applying an algorithm on the logical message. The result of applying the algorithm on the logical message is an opaque message which is communicated to the WS server (the above example message).

Using deep domain knowledge and heuristics the logical message may be extracted and the algorithm which the real client applied may be reconstructed.

According to embodiments of the present invention a tester may now independently edit the logical message or the algorithm using an editor.

During replay, the algorithm may be applied on the logical message, ensuring that server policies are satisfied. This may also refresh any stale or dynamic data (e.g. timestamps, IDs).

There may be no generic way of identifying each algorithm step applied on a message nor reverting the message to its state prior to applying the algorithm on it. Each protocol may have its own set of structures and formats. For example, identifying WS-addressing headers may require querying the message with an XPath expression. In contrast, pinpointing an exact WS-Security configuration may require a correlation between different parts of a message, between a request and its response, and sometimes even between multiple correspondences. For example, when WS-SecureConversation is applied, multiple messages may be exchanged and, only after the last request-response pair, may one fully identify the use of derived encryption keys or signatures.

In terms of metadata, an embodiment of the present invention may be described as follows:

The client may send a message on the wire to the web service server. This message may be a standalone message that does not have any metadata inside it or linked to it.

During code generation heuristics may be used to find the metadata (WSDL) which corresponds to this message. These heuristics may be based, for example on keeping a machine-wide cache for WSDLs, guessing the metadata address based on the destination URL, trying to download it, and/or parsing HTML error messages which the server renders after a false guess.

Now the logical message may be linked to its metadata. This may give the tester a rich set of capabilities such as data-driving, schema-aware data editing, and refreshing the metadata on-demand.

Once the attributes of the intercepted message are determined the client may be configured accordingly.

The automation offered by embodiments of the present invention may save work time of downloading and configuring the services. Also, it may reduce the number of errors that may occur in a manual process. Manual configuration requires wider understanding of Web Services technology, including security and authentication aspects, standards, encoding and so on, which automated configuration may eliminate or greatly reduce.

FIG. 1 illustrates an environment of a testing tool for a server in a network, in accordance with an embodiment of the present invention.

AUT server 106 is designed to service remote clients 104 with an application which is mostly or fully executed on that server.

In the process a remote Web Service may be required, which is hosted on remote WS server 108. Clients 104 may download the appropriate WSDL files from remote WS server 108 so as to allow them to properly cooperate with the AUT server 106.

A testing tool, which may be executed on another server 107 may monitor a business process of client 104 and may emulate a plurality of clients so as to simulate real-life load scenarios.

Reference is now made to FIG. 2 illustrating a method for automated download and configuration of web-services in a testing tool, in accordance with an embodiment of the present invention.

Such method may include analyzing 202 communication requests between a client and an AUT server, which is part of a business process monitored by a testing tool. The method may also include identifying 204 a call to a web service in the analyzed communication requests. The method may further include determining from the web service call the location of a WSDL file relating to the web service on a remote server may be determined 206. Once the location of the WSDL file is determined it may be automatically downloaded 208.

The method may also include automatically configuring 210 the client to work with the WS based on analyzing the web service call.

FIG. 3 illustrates a method for automated download of a web-service in a testing tool, in accordance with an embodiment of the present invention.

For example, such method may include capturing 302 a HTTP message in the communication between a client and a WS server. The location of the WS may be then identified 304 based on message information (for example, by applying heuristics).

Once the location of the WS is determined the appropriate WSDL files may be downloaded 306 to the client.

FIG. 4 illustrates a method for automated configuration of client emulation for work in a testing tool, in accordance with an embodiment of the present invention.

The method may include analyzing 402 the communication between a client and an AUT server, for example a HTTP message and determining 404 attribute of that HTTP message. Based on information related to the determined attribute it may be possible to configure the client emulation 406.

The HTTP headers, soap headers and soap body may be analyzed, and the presence of WS standards (public or vendor proprietary) such as WS-Addressing, Windows Communication Foundation (WCF) binary encoding (WCF is a Microsoft web-service technology), WS-Security may be determined. Based on domain knowledge and heuristics it may be possible to determine how these standards were applied on the captured message, and extract these standards. This way the user may be presented with a standards-free message so he can edit it. These standards may also be applied when performing the testing of the AUT.

FIG. 5 illustrates a system for automated download and configuration of web-services in a testing tool, in accordance with an embodiment of the present invention.

The system may include, for example, a computing device which may include a storage device 508 for storing a computer program for testing an AUT server which may include automated download and configuration of web-services. The system may also include a processor 504 for executing the computer program, Input/output (I/O) interface 502 for input and out put and communication interface 506 for communication with other devices (using direct communication or over a network).

Aspects of the present invention may be embodied as a computer program product saved on one or more computer-readable mediums in the form of computer-readable program code embodied thereon. For example, the computer-readable medium may be a non-transitory storage medium. A computer-readable storage medium may be, for example, an electronic, optical, magnetic, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof.

Computer program code of the above described embodiments of the invention may be written in any suitable programming language. The program code may execute on a single computer, or on a plurality of computers.

The foregoing description of the embodiments of the invention has been presented for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise form disclosed. It should be appreciated by persons skilled in the art that many modifications, variations, substitutions, changes, and equivalents are possible in light of the above teaching. It is, therefore, to be understood that the appended claims are intended to cover all such modifications and changes as fall within the true spirit of the invention. 

1. A method comprising: analyzing communication requests in a business process between a client and a server offering a service application to be tested; identifying a call to a web service in the analyzed communication; determining from the web service call a location of a Web Service Description Language (WSDL) file relating to the web service on a remote server; and downloading the WSDL file from the determined location.
 2. The method of claim 1, wherein the determining step further includes determining a location of a Web Service Description Language (WSDL) file based on a destination indication from the web service call.
 3. The method of claim 1, wherein the analyzing step further includes analyzing a HTTP message in the communication requests.
 4. The method of claim 3, wherein the determining step further includes determining the location from an endpoint of the HTTP message.
 5. The method of claim 1, further including configuring a client emulation to simulate work load on the server offering the service application to be tested.
 6. The method of claim 5, wherein the configuring step includes: analyzing an HTTP message in the communication requests; determining one or more web service standards that were applied on the message from one or more message attributes; and configuring the client emulation based on said one or more web service standards.
 7. A non-transitory computer readable medium having stored thereon instructions which when executed by a processor cause the processor to perform the method of: analyzing communication requests in a business process between a client and a server offering a service application to be tested; identifying a call to a web service in the analyzed communication; determining from the web service call a location of a Web Service Description Language (WSDL) file relating to the web service on a remote server; and downloading the WSDL file from the determined location.
 8. The non-transitory computer readable medium of claim 7, wherein the determining instruction further includes determining a location of a Web Service Description Language (WSDL) file based on a destination indication from the web service call.
 9. The non-transitory computer readable medium of claim 7, wherein the analyzing instruction further includes analyzing a HTTP message in the communication requests.
 10. The non-transitory computer readable medium of claim 9 wherein the determining instruction further includes determining the location from an endpoint of the HTTP message.
 11. The non-transitory computer readable medium of claim 7, wherein further including an instruction for configuring a client emulation to simulate work load on the server offering the service application to be tested.
 12. The non-transitory computer readable medium of claim 11, wherein the configuring instruction further includes: analyzing an HTTP message in the communication; determining one or more web service standards that were applied on the message from one or more message attributes; and configuring the client emulation based on said one or more web service standards.
 13. A computer system comprising: a processor configured to: analyze communication requests in a business process between a client and a server offering a service application to be tested; identify a call to a web service in the analyzed communication; determine from the web service call a location of a Web Service Description Language (WSDL) file relating to the web service on a remote server; and download the WSDL file from the determined location.
 14. The computer system of claim 13, wherein determining the location comprises determining a location of a Web Service Description Language (WSDL) file based on a destination indication from the web service call.
 15. The computer system of claim 13, wherein analyzing of the communication requests includes analyzing a HTTP message in the communication requests.
 16. The computer system of claim 15, wherein determining the location comprises determining the location from an endpoint of the HTTP message.
 17. The computer system of claim 13 wherein the processor is further configured to configure a client emulation to simulate work load on the server offering the service application to be tested.
 18. The computer system of claim 17, wherein in configuring of the client emulation the processor is configured to: analyze an HTTP message in the communication requests; determine one or more web service standards that were applied on the message from one or more message attributes; and configure the client emulation based on said one or more web service standards. 